package com.xbongbong.pro.enums.errorcodes;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;

/**
 * 跟其他第三方应用连接错误枚举
 * @author haibin
 */
@Getter
public enum ThirdPartyUsageErrorCodeEnum implements ErrorCode {
    API_ERROR_900001(900001, "enum.errorCode.msg.api_error_900001"),
    API_ERROR_900002(900002, "enum.errorCode.msg.api_error_900002"),
    API_ERROR_900003(900003, "enum.errorCode.msg.api_error_900003"),
    API_ERROR_900004(900004, "enum.errorCode.msg.api_error_900004"),
    API_ERROR_900005(900005, "enum.errorCode.msg.api_error_900005"),
    API_ERROR_900006(900006, "enum.errorCode.msg.api_error_900006"),
    API_ERROR_900007(900007, "enum.errorCode.msg.api_error_900007"),
    API_ERROR_900008(900008, "enum.errorCode.msg.api_error_900008"),
    API_ERROR_900009(900009, "enum.errorCode.msg.api_error_900009"),

    ;

    /**
     * 错误码
     */
    private final int code;
    /**
     * 错误描述
     */
    private final String msg;

    ThirdPartyUsageErrorCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;

    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return I18nMessageUtil.getMessage(msg);
    }
}
